package com.zm.se.entity;

import javax.validation.constraints.Pattern;
import java.util.Objects;

public class Manager extends BaseEntity{

    private static final long serialVersionUID = 4723941673855519955L;
    //管理员id
    private Integer mid;
    //管理员姓名
    private String username;
    //管理员密码
    private String password;
    //管理员电话
    @Pattern(regexp = "^((13[0-9])|(17[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"
            ,message ="格式错误，请填写正确的手机号")
    private String phone;
    //管理员工号
    @Pattern(regexp = "^[0-9]{10}$"
            ,message ="格式不正确")
    private String num;
    //盐值
    private String salt;

    private String email;

    @Override
    public String toString() {
        return "Manager{" +
                "mid=" + mid +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", num='" + num + '\'' +
                ", salt='" + salt + '\'' +
                ", email='" + email + '\'' +
                ", createdUser='" + createdUser + '\'' +
                ", createdTime=" + createdTime +
                ", modifiedUser='" + modifiedUser + '\'' +
                ", modifiedTime=" + modifiedTime +
                "} " + super.toString();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getMid() {
        return mid;
    }

    public void setMid(Integer mid) {
        this.mid = mid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Manager manager = (Manager) o;
        return mid.equals(manager.mid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mid);
    }


}
